import java.util.Scanner;

public class jiaohuan {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int b,c=1000001;
        int[] a=new int[c];
        a[1]=1;
        a[2]=1;
        b=in.nextInt();
        for (int i = 3; i <=b ; i++) {
            a[i]=(a[i-1]+a[i-2])%10007;
        }
        System.out.println(a[b]);
    }
}
